<template>
  <div>
    <el-table :data="rightList" class="margin-top-20" border>
      <el-table-column label="#" type="index"></el-table-column>
      <el-table-column label="权限名称" prop="authName"></el-table-column>
      <el-table-column label="路径" prop="path"></el-table-column>
      <el-table-column label="权限等级">
        <template slot-scope="scope">
          <el-tag v-if="scope.row.level==0">{{getLevel(scope.row.level)}}</el-tag>
          <el-tag type="success" v-else-if="scope.row.level==1">{{getLevel(scope.row.level)}}</el-tag>
          <el-tag type="warning" v-else-if="scope.row.level==2">{{getLevel(scope.row.level)}}</el-tag>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
  export default {
    name: "rightTable",
    props: {
      rightList: []
    },
    methods: {
      getLevel(level) {
        if (level == 0)
          return '一级'
        else if (level == 1)
          return '二级'
        else if (level == 2)
          return '三级'
        else (level > 2)
          return '特级'
      }
    },
    created() {
    }
  }
</script>

<style scoped>

</style>